#include<bits/stdc++.h>
using namespace std;
#define MAXN 100010
#define fir first
#define sec second
int n,r[MAXN];
map<int,int>spt,jev;
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	cin>>n;
	for(int i=1;i<=n;++i) cin>>r[i],++spt[r[i]],++jev[r[i]];
	int ans=n;
	for(auto it=spt.begin();it!=spt.end();++it){
		auto tmp=jev.begin();
		for(int i=0;i<it->sec;++i){
			tmp=jev.upper_bound(it->fir);
			if(tmp==jev.end()) break;
			--ans;
			if(!--tmp->sec) jev.erase(tmp);
		}
	}cout<<ans<<endl;
	fclose(stdin);
	fclose(stdout);
	return 0;
}